<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
	Schema::create('messages', function (Blueprint $table) {
	    $table->id();
	    $table->string('name')->default('一位朋友'); // 留言者名字
	    $table->text('content');                   // 留言内容
	    $table->unsignedInteger('likes')->default(0); // 点赞数（模拟“点亮”）
	    $table->timestamps();
	});
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('messages');
    }
}
